import {postGoReq} from "./goApis";

// params 映射表
const URL_CONFIG = {

    // 基础接口
    teamList: 'api/sports/football/team/list',
    profileUpdate: 'api/sports/football/update/profile',
    eventList: 'api/sports/football/matchevent/list',
    deletedMatch: 'api/sports/football/match/deleted_ids',

    // 即时数据
    detailLive: 'api/sports/football/match/detail_live',
    live: 'api/sports/football/match/live2',
    list: 'api/sports/football/match/list',

    // 赛事分析
    analysis: 'api/sports/football/match/analysis',
    lineup: 'api/sports/football/match/lineup',
    gameDetail: 'api/sports/football/match/detail',

    // 即时指数
    oddsLiveHistory: 'api/sports/football/odds/live_history',
    oddsHistory: 'api/sports/football/odds/history',

    // 百欧指数
    oddsEuropeHistory: 'api/sports/football/odds/europe/history',
    oddsCompanyList: 'api/sports/odds/company/list',
    oddsEuropeLive: 'api/sports/football/odds/europe/live',

    // 情报分析
    intelligence: 'api/sports/football/match/intelligence',

    // 集锦
    highLight: 'api/video_collection/by_match',

    // 资料库
    stats: 'api/sports/football/season/stats',
    players: 'api/sports/football/player/list'
}

// 基础接口
// 足球球队资料请求
export const fetchTeamListReq = (params, toast) => postGoReq('gameproxy', {
    data: `${URL_CONFIG.teamList}`,
}, toast)
// 赛事球队变动
export const fetchProfileUpdateReq = (params, toast) => postGoReq('gameproxy', {
    data: `${URL_CONFIG.profileUpdate}`,
}, toast)
// 赛事资料
export const fetchEventListReq = (params, toast) => postGoReq('gameproxy', {
    data: `${URL_CONFIG.eventList}`,
})
// 足球删除比赛
export const fetchDeletedMatchReq = (params, toast) => postGoReq('gameproxoy', {
    data: `${URL_CONFIG.deletedMatch}`,
})

// 即时数据
// 足球赛程赛果
export const fetchNanoGameListReq = (params, toast) => postGoReq('gameproxy', {
    data: `${URL_CONFIG.list}?date=${params.date}`,
}, toast)
// 足球即时比分
export const  fetchNanoGameLiveListReq = (params, toast) => postGoReq('gameproxy', {
    data: URL_CONFIG.live,
}, false)
// 足球实时统计
export const fetchGameDetailLiveReq = (params, toast) => postGoReq('gameproxy', {
    data: `${URL_CONFIG.detailLive}`,
}, toast)


// 赛事分析
// 足球比赛详情 一般不调用这个接口 因为获取比赛详情的同时还需要获取聊天室token 请看 goApi.js
export const fetchGameDetailVisitReq = (params, toast) => postGoReq('gameproxy', {
    data: `${URL_CONFIG.gameDetail}?id=${params.id}`,
}, toast)
// 足球比赛阵容
// 根据 赛程赛果接口 中 是否有阵容 字段来判断是否开启该比赛的阵容接口读取
export const fetchLineUpReq = (params, toast) => postGoReq('gameproxy', {
    data: `${URL_CONFIG.lineup}?id=${params.id}`,
}, toast)
// 足球分析数据
export const fetchGameAnalysisReq = (params, toast) => postGoReq('gameproxy', {
    data: `${URL_CONFIG.analysis}?id=${params.id}`,
}, toast)

// 即时指数
// 足球实时指数
export const fetchOddsListAllReq = (params, toast) => postGoReq('gameproxy', {
    data: `${URL_CONFIG.oddsLiveHistory}`,
}, toast)
// 单场指数历史
export const fetchOddsListReq = (params, toast) => postGoReq('gameproxy', {
    data: `${URL_CONFIG.oddsHistory}?id=${params.id}`,
}, toast)

// 百欧指数
// 单场百欧指数
export const fetchOddsEuroReq = (params, toast) => postGoReq('gameproxy', {
    data: `${URL_CONFIG.oddsEuropeHistory}`,
}, toast)
// 百欧公司列表
export const fetchEuroCompanyListReq = (params, toast) => postGoReq('gameproxy', {
    data: `${URL_CONFIG.oddsCompanyList}`,
}, toast)
// 实时百欧指数
export const fetchOddsEuroLiveReq = (params, toast) => postGoReq('gameproxy', {
    data: `${URL_CONFIG.oddsEuropeLive}`,
}, toast)

// 情报分析接口
export const fetchGameIntelligence = (params, toast) => postGoReq('gameproxy', {
    data: `${URL_CONFIG.intelligence}?id=${params.id}`,
}, toast)

// 集锦
export const fetchHighLightReq = (params, toast) => postGoReq('gameproxy', {
    data: `${URL_CONFIG.highLight}?sport_id=1&match_id=${params.matchId}`,
})

// 技术统计
export const fetchStatsReq = (params,) => postGoReq('gameproxy', {
    data: `${URL_CONFIG.stats}`,
})
export const fetchPlayers = (params,) => postGoReq('gameproxy', {
    data: `${URL_CONFIG.players}`
})
